gl renderer: Fix render node texture cache
authorAlexander Larsson <alexl@redhat.com>
Wed, 30 Sep 2020 12:53:13 +0000 (14:53 +0200)
committerAlexander Larsson <alexl@redhat.com>
Wed, 30 Sep 2020 12:53:13 +0000 (14:53 +0200)
commite14d2be1e833c75aa48ba056464d4e23950864a9
tree8ab1a19e90822aed5161ac211ed73aff242f8623
parente9885f9cdee2121f927f3b5b0c5603cf148acd3b
gl renderer: Fix render node texture cache

We're caching two things, either a node itself being rendered, or a
parent storing a cached version of a child as rendered to an offscreen
the size and location of the parent.

If both the parent and child uses the cache this will cause a conflict in
the cache as it is currently use keying of a node pointer which will have
the same value for the node-as-itself and the child-node-of-the-parent.

We fix this by adding another part to the key "pointer_is_child" which means
we can have the same node pointer twice in the cache.

Additionally, in the child-is-rendered-offscreen case the offscreen
result actually depends on the position and size of the parent viewport,
so we need to store the parent bounds in that case.
gsk/gl/gskgldriver.c
gsk/gl/gskgldriverprivate.h
gsk/gl/gskglrenderer.c